<?php

require_once('luckyflagmodel.php');

/**
 * 
 * 
 * @author Chris Rees
 */
class ProjectModel extends LuckyFlagModel {


    protected $table = 'projects_table';
    public $columns = array(
        'project_id' => '',
        'project_name' => '',
        'project_type' => '',
        'project_description' => '',
        'project_website' => '',
        'project_email' => '',
        'project_created' => '',
        'project_lastopened' => '',
        'project_creator' => ''
    );

    /**
     * 
     */
    public function __contruct() {
        parent::__construct();
    }

    /**
     * 
     */
    public function insertProject() {
        $this->columns['project_lastopened'] = time();
        $this->columns['project_created'] = $this->columns['project_lastopened'];
        $this->db->insert($table, $this->columns);
        $this->last_id = $this->db->insert_id();
        return $this;
    }

    /**
     *
     * @return type 
     */
    public function insert_id() {
        return $this->last_id;
    }

    /**
     *
     * @return type 
     */
    public function getAllProjects() {
        $query = $this->db->get($this->table);
        return $query->result();
    }

    /**
     * 
     */
    public function updateProject() {
        
    }

    public function addTask() {
        
    }

    public function addUser() {
        
    }

}